package Libs.Utils.Strings
{
	public const Compare:Function = function( str1:String, str2:String, strict:Boolean = false ):int
    {
        if( !strict )
        {
            str1 = str1.toLowerCase();
            str2 = str2.toLowerCase();
        }
        
        if( str1 == str2 )
        {
            return 0;
        }
        else if( str1.length == str2.length )
        {
            var local:int = str1.localeCompare( str2 );
            
            if( local == 0 )
            {
                return 0;
            }
            else if( local < 0 )
            {
                return 1;
            }
            
            return -1;
        }
        else if( str1.length > str2.length )
        {
            return 1;
        }
        else
        {
            return -1;
        }
    };
}